﻿


using IotContract.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XT.Common.Enums;
using XT.Common.Models.SignalR;
using XT.Common.Services;

namespace IotContract.Extensions;
public static class LogExtension
{
    /// <summary>
    /// 远程日志（signalR必须连通）
    /// </summary> 
        public static async Task LogContent(this ILogService logService, string content, LogEnum logType, string flag, string title = "IotServer", bool isToDB = false)
        {
            await logService.LogRemote(new RemoteLog
            {
                Content = content,
                IsToDB = isToDB,
                IsToRemote = true,
                Title = title,
                ID=IotProgramType.IotServer.ToString(),
                Type = logType,
                Flag = flag
            });
        }
    
}
